﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DIT.DB.Database
{
    public static class DBCommandExtension
    {
        public static void AddParameter(this IDbCommand command, string parameterName, object value, DbType dbType, ParameterDirection direction = ParameterDirection.Input)
        {
            IDbDataParameter parameter = command.CreateParameter();
            parameter.ParameterName = parameterName;
            parameter.Value = value;
            parameter.DbType = dbType;
            parameter.Direction = direction;
            command.Parameters.Add(parameter);
        }
    }
}
